import { COMMENT_LIST_DATA } from './actionType'
import axios from 'axios'

export const getCommentData = () => async dispatch => {
  dispatch({
    type: 'SETLOADSTATE',
    obj: false
  });
  let resp = await axios({
    method: 'get',
    url: './json/comments.json'
  })
  dispatch({
    type: COMMENT_LIST_DATA,
    obj: resp.data
  })

  dispatch({
    type: 'SETLOADSTATE',
    obj: true
  });
}
